﻿@model Tyshka.Subroutines.ViewModels.SubroutineListingModel

@{
    ViewBag.Title = "Index";
}

<script language="javascript" type="text/javascript">
    $(document).ready(function () {
        $("#tagList").tablesorter();
    }
); 
</script>

			<div class="row">
				<div class="span8">
					<div class="bright_block">
						<div class="row">
							<div class="span5">
								<h1>Subroutine Listing</h1>				
							</div>
						</div>
                        @if (Model.UploadAllowed)
                        {
                        <div class="row" style="margin-top:25px;">
                            <div class="span7">
                                <a href="@Url.Action("New", "Subroutine")"  class="btn btn-primary btn-large">Upload subroutine</a>
                            </div>
                        </div>
                        }
					
						<div class="row" style="margin-top:25px;">
							<div class="span7">
								To see tagged view, please select "Tags" from main menu.
							</div>
						</div>
					</div>
					<div class="bright_block">
						<h3>Stats</h3>
						<b>@Model.SubroutineCount</b> subroutine(s) uploaded by <b>@Model.UserCount</b> user(s)
					</div>
				</div>
				<div class="span4 dcpu_logo">
					<!-- -->
				</div>
			</div>
			
			<div class="row">
				<div class="span12">	
					<div class="bright_block">
					
					    
                    
					<table class="table table-striped" id="tagList">
						<thead>
							<tr>
								<th>Subroutine</th>
								<th>Author</th>
                                <th>Rating</th>
							</tr>
						</thead>
						<tbody>
                            @foreach(var subroutine in Model.Items){
                                <tr>
                                <td>@Url.SubroutineDetailLink(subroutine.Id, subroutine.Name)</td>

                                <td>@subroutine.Author</td>
                                <td>@subroutine.Votes</td>
                                </tr>
                                }
                                
						</tbody>
					</table>
					</div>
				</div>
			</div>
			
			
			